<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>商品列表</title>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="../../css/bootstrap.min.css">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="../../js/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="../../js/bootstrap.min.js"></script>
</head>
<body>
<div style="padding:0px; margin:0px;">
    <ul class="breadcrumb" style="  margin:0px; ">
        <li>商品中心</li>
        <li>商品管理</li>
        <li>商品列表</li>
    </ul>
</div>
<div class="row alert alert-info" style="margin:0px; padding:3px;">
    <form class="form-inline" action="http://localhost:8080/supermarket/SelectProductServlet/product/product_list">
        <div class="form-group">
            <label class="" for="activename">商品名称：</label>
            <input type="text" name="product_name" class="form-control" id="activename" placeholder="请输入商品名称">
        </div>
        <input type="submit" class="btn btn-danger" value="查询"/>
    </form>
</div>
<div class="row" style="padding:15px; padding-top:0px; ">
    <table class="table  table-condensed table-striped">
        <tr>
            <th>商品条码</th>
            <th>品类</th>
            <th>商品名称</th>
            <th>销售单价(元)</th>
            <th>供应商</th>
            <th>操作</th>
        </tr>
        <c:if test="${productList.size()>0}">
        <c:forEach items="${productList}" var="productList">
            <tr>
                <td>${productList.getBar_code()}</td>
                <td>${productList.getCategory_name()}</td>
                <td>${productList.getProduct_name()}</td>
                <td>${productList.getSale_price()}</td>
                <td>${productList.getSupplier_name()}</td>
                <td>
                    <a href="http://localhost:8080/supermarket/ProductUpdateServlet/product/product_modify?Bar_code=${productList.getBar_code()}">修改</a>
                    <a href="http://localhost:8080/supermarket/DeleteProductServlet?bar_code=${productList.getBar_code()}">删除</a>
                </td>
            </tr>
        </c:forEach>
        </c:if>
        <c:if test="${productList.size()==0}">
            <tr>没有查询到信息</tr>
        </c:if>

    </table>

        <nav aria-label="...">
            <ul class="pagination">
                <li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
                <c:forEach begin="1" end="${page}" var="i">
                    <li class=""><a href="http://localhost:8080/supermarket/IndexProductListServlet/product/product_list?page=${i}">${i} <span class="sr-only">(current)</span></a></li>
                </c:forEach>
            </ul>
        </nav>
</div>
</body>
</html>
